<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function toString() {console.log("name: " + this.name + " age: " + this.age + " sex: " + this.sex);}
        var obj = {name: '李华', age: 18, sex: '男', toString};
        obj.toString();
        // var obj1 = {name:'小红', age:18, sex:'女', say(text){console.log(text);}}
        // for (k in obj1) {
        //     if ((typeof obj1[k]) === 'function') {
        //         [k]("hhh");
        //     }else
        //     console.log(k + " : " + obj1[k]);
        // }
    </script>
</body>
</html>